<div class="payment_contain">
   <!-- <?php if(!$plaseOreder):?>
    <div class="payment_total">
        <strong>Sub Total: </strong><span class="price calculated">
            BDT: <?php

            if(!$shopping_cart->isEmpty()){
                echo ($shopping_cart->getTotal()+($shippingMethod->cost+$shippingMethod->handling_cost));
            }
            else {echo '0';};
            ?>
        </span>
    </div>
    <?php endif;?> -->
    <form name="payment_method" action="" method="post">
        <b>Payment method</b>
           
        <div id="payment_methods">
             <?php
             if(!$selectedMethodId):
            $payment_value = 0;
            foreach($paymentmethods as $key => $paymentmethod):
            ?>
            <input name="payment_method_id" type="radio" <?php echo (!$selectedMethodId && $key == 0)?'checked':($selectedMethodId == $paymentmethod->id)?'checked':''?> value="<?php echo $paymentmethod->id?>" id="" name="payment_method">
            <label for="<?php echo $paymentmethod?>"><strong><?php echo $paymentmethod?></strong></label>
            <?php endforeach;?>
            <?php else:?>
            <input name="payment_method_id" type="radio" checked value="<?php echo $selectedPaymentMethod->id?>" id="" name="payment_method">
            <label for="<?php echo $paymentmethod?>"><strong><?php echo $selectedPaymentMethod?></strong></label>
            <?php endif;?>
            <br>
        </div>
        <div class="paymen_button">
            <input name="update_payment" type="hidden" value="0" id="update_payment"/>
            <?php if($plaseOreder):?>
            <button onclick="window.location = '<?php echo _link('main/addToCart')->getHref()?>';return false;" type="button" title="Update Shopping Cart" class="button"><span><span>Edit Shopping Cart</span></span></button>
            <button style="float: right" onclick="window.location = '<?php echo _link('+/customarOrder/addCustomerOrder')->getHref()?>';return false;" type="button" title="Update Shopping Cart" class="button"><span><span>Place Order</span></span></button>
            <?php else:?>
            <button onclick="window.location = '<?php echo _link('main/addToCart')->getHref()?>';return false;" type="button" title="Update Shopping Cart" class="button"><span><span>Edit Shopping Cart</span></span></button>
            
            <button style="float: right" type="submit" title="Continue Shopping" class="button btn-continue" onclick="$('#update_payment').val(1);$(this).parents('form').attr('action', '').submit()"><span><span>Continue Checkout</span></span></button>
            <?php endif;?>
        </div>


    </form>
    <?php if($plaseOreder):?>
    <table class="placeorder" width="100%">
        <tr>
            <td>Product name:<br/></td><td>&nbsp;</td></tr>
            <?php foreach($shopping_cart->getItems() as $key=>$item):?>
        <tr>
            <td colspan="2">
                <table>
                <?php
                    $object = ProductTable::getInstance()->find($item->getId())
                ?>
                    <tr>
                        <td><?php echo ($key+1)?>. </td>
                        <td><h2><?php echo $object ?></h2></td>
                        <td>&nbsp;$<?php echo $item->getPrice()?></td>
                         <?php //echo '&nbsp;&nbsp;&nbsp;'.($key+1).'.    '.$object.'   '.$item->getPrice().'<br/>'?>
                     </tr>
                  </table>
                </td>
            <?php endforeach;?>
        </tr>
        <tr>
            <td>Product total cost:</td>
            <td>BDT: <?php echo $shopping_cart->getTotal()?></td>
        </tr>
        <tr>
            <td>Shipping method:</td>
            <td> BDT: <?php echo $shippingMethod.'       Cost: '.($shippingMethod->cost+$shippingMethod->handling_cost)?></td>
        </tr>
        <tr>
            <td>Payment method: </td>
            <td><?php echo $selectedPaymentMethod?></td>
        </tr>
        <tr>
            <td>Total cost: </td>
            <td><h3>BDT: <?php echo ($shopping_cart->getTotal()+($shippingMethod->cost+$shippingMethod->handling_cost))?></h3></td>
        </tr>
    </table>
    <?php endif;?>

</div>